package com.pi.file;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class FileDo {
	  /**
	   * 读取文件的内容 返回list集合
	   * @param fileName
	   * @return 
	 * @throws IOException 
	   */
      public static List<String> readFile(String fileName) throws IOException{
    	  
    	  List<String> list = new ArrayList<String>();
    	  FileInputStream fis=new FileInputStream(fileName);
          InputStreamReader isr=new InputStreamReader(fis, "UTF-8");
          BufferedReader br = new BufferedReader(isr);
          String line="";
          while ((line=br.readLine())!=null) {
        	  list.add(line);
          }
          br.close();
          isr.close();
          fis.close();
		  return list;
      }
}
